'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: module.py
* @Time: 2025/9/18
* @All Rights Reserve By Brtc
'''
from flask_login import LoginManager
from flask_migrate import Migrate
from injector import Module, Binder, Injector
from redis import Redis

from internal.extension.database_extension import llmops_db
from internal.extension.login_extension import login_manager
from internal.extension.migrate_extension import migrate
from internal.extension.redis_extension import redis_client
from pkg.sqlachemy.sqlalchemy import SQLAlchemy


class ExtensionModule(Module):
    """扩展模块的注入"""
    def configure(self, binder: Binder) -> None:
        binder.bind(SQLAlchemy, to=llmops_db)
        binder.bind(Migrate, to=migrate)
        binder.bind(Redis, to=redis_client)
        binder.bind(LoginManager, to = login_manager)

#flak 注入实体的容器
app_injector = Injector([ExtensionModule])

